﻿/*----------------------------------------------------------------
  //Copyright (C) 2012 赵国伟
  //文件功能描述：商品最终页
  //创建人：赵国伟
  //生成时间：2012/03/17 16:15:00
//----------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Shopping.Common;
using Shopping.Model;
using Shopping.BLL;


public partial class Show : BasePage
{
    protected GoodsInfo goodsInfo; //存储商品信息；
    protected int PackID;
    protected List<Categories> categoryMenu;
    protected string parentCategoryName;
    protected URLManage bllUrl = new URLManage();
    protected List<Categories> categoryNav;


    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            int goodsId = Utility.G<int>("ID");
            PackID = Utility.G<int>("PackID");
            if (goodsId <= 0)
                Utility.ShowErrorTips("商品ID错误！");

            GoodsManage bllGoods = new GoodsManage();
            goodsInfo = bllGoods.GetGoods(goodsId);

            if (goodsInfo.BaseInfo.Status == Status.已删除.ToString())
            {
                Utility.ShowErrorTips("系统提示：您查看的商品不存在或已下架删除！","/index.aspx");
            }

            bllGoods.UpdateClicks(goodsId);
            if (PackID == 0)
                PackID = goodsInfo.BaseInfo.PackUnitID;
            CategoriesManage bllCategory = new CategoriesManage();
            Categories c = bllCategory.GetCategoryInfo(goodsInfo.BaseInfo.CategoryID);
            parentCategoryName = bllCategory.GetCategoriesName(c.ParentID);
            categoryMenu = bllCategory.QueryChirldCategory(c.ParentID, true);
            categoryNav = bllCategory.QueryTreeCategories(goodsInfo.BaseInfo.CategoryID);
        }
    }


}